package net.csdn.business.discuss.feign.api;


import net.csdn.business.discuss.common.constant.ServiceNameConstants;
import net.csdn.business.discuss.common.model.dto.UserRoleDto;
import net.csdn.business.discuss.common.model.vo.ProjectVo;
import net.csdn.business.discuss.common.model.vo.UserInfoVO;
import net.csdn.business.discuss.feign.decoder.SystemFeignErrorDecoder;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Auther: zhangyalei
 * @Date: 2022/12/21 16:59
 * @Description:
 */
@FeignClient(value = ServiceNameConstants.ATOMGIT_SYSTEM_SERVICE,contextId = ServiceNameConstants.ATOMGIT_SYSTEM_PROJECT_CONTEXT_ID,  configuration = SystemFeignErrorDecoder.class)
public interface ProjectFeignClient {

    /**
     * @Desc: 批量查询项目成员信息
     * @Author: zhangyalei
     * @Date: 2023/1/11 15:18
     */
    @GetMapping("/api/v1/project/memberAll/{projectId}")
    public List<UserInfoVO>  getProjectMemberAll(@PathVariable("projectId") String projectId);


    /**
     * @Desc: 查询项目的的成员角色
     * @Author: zhangyalei
     * @Date: 2023/1/11 15:18
     */
    @PostMapping("/api/v1/project/getAccessLevel")
    public Integer getProjectAccessLevel(@RequestBody UserRoleDto params);

    @GetMapping("/api/v1/project/get")
    ProjectVo getProjectById(@RequestParam(value = "projectId") Long projectId);

    @GetMapping("/api/v1/project/memberIds/{projectId}")
    List<String> getRepoMemberIds(@PathVariable("projectId") String projectId);

}